﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EfCore.Configers
{
    public class EEDConfigers : IEntityTypeConfiguration<EED>
    {
        public void Configure(EntityTypeBuilder<EED> builder)
        {
            builder.ToTable("EED"); // 设置表名
            builder.HasKey(e => e.ExdId); // 设置主键
            builder.Property(e => e.ExdId).HasColumnName("ExdId").ValueGeneratedOnAdd(); // 设置自增列
            builder.Property(e => e.ExamNumber).HasColumnName("ExamNumber"); // 设置试卷编号列
            builder.Property(e => e.FirstKindId).HasColumnName("FirstKindId"); // 设置试题一级分类编号列
            builder.Property(e => e.FirstKindName).HasColumnName("FirstKindName"); // 设置试题一级分类名称列
            builder.Property(e => e.SecondKindId).HasColumnName("SecondKindId"); // 设置试题二级分类编号列
            builder.Property(e => e.SecondKindName).HasColumnName("SecondKindName"); // 设置试题二级分类名称列
            builder.Property(e => e.QuestionAmount).HasColumnName("QuestionAmount"); // 设置出题数量列
                                                                                     // 设置其他属性的配置...
        }
    }

}
